//
//  PPPetTypeArrayList.m
//  PetParadise
//
//  Created by 陈无忌 on 8/20/14.
//  Copyright (c) 2014 whalefin. All rights reserved.
//

#import "PPPetTypeArrayList.h"

@interface PPPetTypeArrayList()
//@property (nonatomic, strong) NSDictionary *breedDic;

@end

@implementation PPPetTypeArrayList
//-(NSDictionary *)breedDic
//{
//    if (!_breedDic) {
//        //找到Documents文件所在的路径
//        NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
//        //取得第一个Documents文件夹的路径
//        NSString *filePath = [path objectAtIndex:0];
//        //把TestPlist文件加入
//        NSString *plistPath = [filePath stringByAppendingPathComponent:@"petBreed.plist"];
//        _breedDic = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
//    }
//    return _breedDic;
//}


+(NSArray *)getType {
//    NSFileManager *fileManager = [NSFileManager defaultManager];
//    //找到Documents文件所在的路径
//    NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
//    //取得第一个Documents文件夹的路径
//    NSString *filePath = [path objectAtIndex:0];
//    //把TestPlist文件加入
//    NSString *plistPath = [filePath stringByAppendingPathComponent:@"petBreed.plist"];
////
//    NSDictionary *breedDic = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
    NSArray *petType = @[@"狗",@"猫",@"鸟",@"虫",@"鱼",@"小宠",@"两爬"];
//    [breedDic allKeys];

  
    
    return petType;
}


+(NSArray *)getBreedWithType:(NSString *)type{

    //    NSFileManager *fileManager = [NSFileManager defaultManager];
    //找到Documents文件所在的路径
    NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    //取得第一个Documents文件夹的路径
    NSString *filePath = [path objectAtIndex:0];
    //把TestPlist文件加入
    NSString *plistPath = [filePath stringByAppendingPathComponent:@"petBreed.plist"];
    //
    NSDictionary *breedDic = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
    
    
    NSArray *petBreedArray = [breedDic objectForKey:type];
    
    return petBreedArray;
}

@end
